void ShortestDist(LGraph Graph, int dist[], Vertex S)
{
	int Front = 0, Rear = 0;
	Vertex* queue = (Vertex*)malloc(MaxVertexNum * sizeof(Vertex));
	for (int i = 0; i < MaxVertexNum; i++)
		queue[i] = dist[i] = -1;
		queue[0] = S;
		dist[S] = 0;
	PtrToAdjVNode ptr;
	while (Front <= Rear) {
		ptr = Graph->G[queue[Front]].FirstEdge;
		while (ptr != NULL) {
			if (dist[ptr->AdjV] == -1) {
				dist[ptr->AdjV] = dist[queue[Front]] + 1;
				queue[++Rear] = ptr->AdjV;
			}
			ptr = ptr->Next;
		}
		Front++;
	}
}
